$(function() {	
	$('#huodg21').datagrid({
		//请求地址
	    url:'../card/getCheckReport',
	    columns:[[
	    	{field:'',title:'',checkbox:true},
			{field:'monthId',title:'月份',width:'8%'},
			{field:'empId',title:'员工编号',width:'8%',
				formatter: function(value,row,index){
					if (row.emp){
						return row.emp.empId;
					} else {
						return "";
					}
				}},
				{field:'empId',title:'员工名称',width:'8%',
					formatter: function(value,row,index){
						if (row.emp){
							return row.emp.empName;
						} else {
							return "";
						}
					}},
			{field:'beginTime',title:'开始时间',width:'10%'},
			{field:'salaryTime',title:'结束时间',width:'10%'},
			{field:'shouldAttendance',title:'应出勤天数',width:'10%'},
			{field:'actualAttendance',title:'实出勤天数',width:'10%'},
			{field:'absenteeismNumber',title:'缺勤天数',width:'10%'},
			{field:'lateNumber',title:'迟到次数',width:'10%'},
			{field:'totalOvertime',title:'迟到时长',width:'10%'},
			{field:'earlyNumber',title:'早退次数',width:'10%'},
			{field:'totalearlyTime',title:'早退时长',width:'10%'},
			{field:'totalPayholiday',title:'带薪假期',width:'10%'},
			{field:'totalNopayholiday',title:'无薪假期',width:'10%'},
			{field:'totalWorkday',title:'工作日加班总时长',width:'10%'},
			{field:'totalWeek',title:'周末加班总时长',width:'10%'},
			{field:'totalHoliday',title:'节假日加班总时长',width:'10%'},
			{field:'totalOvertime',title:'加班总时长',width:'10%'},
			{field:'maker',title:'创建者',width:'10%'},
			{field:'makeTime',title:'创建日期',width:'10%'},		
			{field:'state',title:'状态',width:'8%',
				formatter : function(value, row, index) {
					if (row.state==='是') { 
					var btns = "<a href='#' id='huoremove21' class='easyui-linkbutton'></a>";
					return btns;
					}
				}
			}] ],
     onLoadSuccess : function(data) {
			$("#huo21remove").linkbutton({
				plain : true,
				iconCls : 'icon-remove'
			});
		},
		onLoadError:function(data){
			alert("加载失败")
		},
	    fit:true,
	    //fit:true
	    fitColumns:true,
	    //隔行变色
	    striped:true,
	    nowrap:true,
	    //显示行号
	    rownumbers:true,
	    //设置单选
	    singleSelect:true,
		toolbar:'#huotb21',
		//显示分页栏
		pagination:true,
		//设置每页大小
		pageSize:20,
		//可选的每页大小
		pageList:[5,10,20,50]
	});
});
 function searchname(value){
	 $('#huodg21').datagrid('load','../card/serchCheckMonthReport?value='+value);
} 